package com.spddr.pmos.jpa;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import cn.seqdata.jpa.JpaNoGeneratedObject;

@Entity
@Table(name = "trade_way_info")
public class TradeWay extends JpaNoGeneratedObject {
	@Override
	public String toString() {
		return "TradeWay [pid=" + pid + ", id=" + id + "]";
	}

	private static final long serialVersionUID = 1L;

	private TradeWay pid;
	private String remark;
	
	@Column(name="remark")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public TradeWay() {
	}

	public TradeWay(Long id) {
		super(id);
	}

	public TradeWay(Long id, String name) {
		super(id, name);
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "pid", nullable = true)
	@JsonSerialize(using = cn.seqdata.jackson.ObjectSerializer.IdName.class)
	public TradeWay getPid() {
		return this.pid;
	}

	public void setPid(TradeWay pid) {
		this.pid = pid;
	}
}